//
//  CycLanguage.h
//  Cycling
//
//  Created by cjg.mini on 2023/4/11.
//

#import <Foundation/Foundation.h>

extern NSString * const CycAppLanguageKey;

extern NSString * const CycChinesePrefix;
extern NSString * const CycEnglishPrefix;

extern NSString * const CycEnglishLanguageName;
extern NSString * const CycChineseLanguageName;

#define CycLocalizedStringFromTable(key, tbl, comment) \
[[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@",[[NSUserDefaults standardUserDefaults] objectForKey:@"appLanguage"]] ofType:@"lproj"]] localizedStringForKey:(key) value:@"" table:(tbl)]

#define CycLocalizedString(key, comment) CycLocalizedStringFromTable(key, @"Localizable", comment)

@interface CycLanguage : NSObject

+ (CycLanguage *)sharedInstance;

- (void)configLanguage;

- (void)setLanguage:(NSString *)language;

- (void)setLanguageWithLanguageName:(NSString *)languageName;

- (NSString *)currentLanguage;

- (BOOL)isChinese;

@end


